// import { createHashRouter } from "react-router-dom";
// 重定向
import React from "react";
import { createBrowserRouter, useNavigate } from "react-router-dom";
import App from "./App";
// import Index from "./page/index";
import Home from "./page/home";
import ReInfo from "./page/Reinfo";
// import Quick from "./page/quick/quick";
import Register from "./page/register/register";
import Code from "./page/code/code";
import ChangePhone from "./page/changePhone";
import ReInfoChange from "./page/ReinfoChange/index";
// import Login from "./page/login/login";
import MemberCar from "./page/menberCar/index";

// const router = createHashRouter([
//   {
//     path: "/",
//     element: <App />,
//     loader() {},
//     children: [
//       {
//         path: "index",
//         element: <Index />,
//       },
//       {
//         path: "quick",
//         element: <Quick />,
//       },
//       {
//         path: "register",
//         element: <Register />,
//       },
//       {
//         path: "code",
//         element: <Code />,
//       },
//       {
//         index: true,
//         // path: "login",
//         element: <Login />,
//       },
//     ],
//   },
//   {
//     path: "/testType",
//     element: <TestType />,
//   },
//   {
//     path: "*",
//     element: <>404Found Page</>,
//   },
// ]);



const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    // loader() {},
    children: [
      {
        index: true,
        // path: "register",
        element: <Register />,
      },
      {
        path: "reinfo",
        element: <ReInfo />,
      },
      //
      {
        path: "infochange",
        element: <ReInfoChange />,
      },
      // {
      //   path: "index",
      //   element: <Index />,
      // },
      {
        path: "home",
        element: <Home />,
      },
      {
        path: "code",
        element: <Code />,
      },
      {
        path: "phone",
        element: <ChangePhone />,
      },
      {
        path: "memberCar",
        element: <MemberCar />,
      },
      // {
      //   // index: true,
      //   path: "login",
      //   element: <Login />,
      // },
    ],
  },
  // {
  //   path: "/testType",
  //   element: <TestType />,
  // },
  {
    path: "*",
    // element: <>404 Found Page</>
    element: <Register />,
  },
]);
export default router;
